package main

import (
	"fmt"
	"github.com/pkg/errors"
	_ "github.com/tim1020/godaemon"
	. "logs"
	"monitor/webser"
	"os"
	. "tcpNetWorking/lib"
)

func server() error {
	endpoint := NewEndPoint()

	endpoint.AddHandleFunc("string", HandleStrings)
	endpoint.AddHandleFunc("gob", HandleGob)

	// 开始监听
	return endpoint.Listen()
}

func main() {
	os.Truncate(LOGPATH, 0)
	GetConfigInput("server")
	go webser.Start()
	err := server()
	if err != nil {
		fmt.Println("Error:", errors.WithStack(err))
	}
}
